package com.yinhai.msg.systemChannel.rest;

import com.yinhai.msg.systemChannel.entity.MsgSystemChannelPo;
import com.yinhai.msg.systemChannel.entity.MsgSystemDicPo;
import com.yinhai.msg.systemChannel.service.read.MsgSystemChannelReadService;
import com.yinhai.msg.systemChannel.service.write.MsgSystemChannelWriteService;
import com.yinhai.ta404.core.restservice.BaseRestService;
import com.yinhai.ta404.core.restservice.annotation.RestService;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbaen.Page;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * 系统与渠道绑定控制层
 * @author: zhangxj
 * @create: 2019-05-24 14:44
 */
@RestService({"msg/systemChannel"})
@Validated
public class MsgSystemChannelRestService extends BaseRestService {
    @Resource
    private MsgSystemChannelReadService msgSystemChannelReadService;
    @Resource
    private MsgSystemChannelWriteService msgSystemChannelWriteService;

    @PostMapping("queryAll")
    public void  queryAll(MsgSystemChannelPo msgSystemChannelPo, PageParam pageParam){
        Page<MsgSystemChannelPo> result=msgSystemChannelReadService.queryAll(msgSystemChannelPo,pageParam);
        setPageBean(result);
    }
    @PostMapping("queryMsgSystem")
    public void queryMsgSystem(){
        List<MsgSystemDicPo> result=msgSystemChannelReadService.queryMsgSystem();
        this.setData("msgSystemList",result);
    }

    @PostMapping("queryChannel")
    public void queryChannel(MsgSystemChannelPo msgSystemChannelPo, PageParam pageParam){
        Page<MsgSystemChannelPo>  result=msgSystemChannelReadService.queryChannel(msgSystemChannelPo,pageParam);
        setPageBean(result);
    }
}
